package com.tvunetworks.center.user.service;

import com.tvunetworks.center.user.model.RoleDevice;

import java.util.List;
import java.util.Set;

/**
 * @author Etan Yang
 * @data: 2021/4/7 15:53
 * @program: tvucc-aggregator
 * @description:
 */

public interface RoleDeviceService {
    /**
     * 批量插入数据
     * @param roleId roleId
     * @param peerIds peerIds
     * @return int
     */
    int batchInsert(String roleId, Set<String> peerIds);

    /**
     * 根据roleId和peerId的集合删除RoleDevice
     * @param roleId roleId
     * @param peerIds peerIds
     */
    void batchDeleteByRoleIdAndPeerIds(String roleId, List<String> peerIds);

    /**
     * 根据roleId删除所有的RoleDevice
     * @param roleId roleId
     * @return int
     */
    int deleteByRoleId(String roleId);

    /**
     * 根据roleId获取所有的PeerId
     * @param roleId roleId
     * @return List
     */
    List<String> getPeerIdsByRoleId(String roleId);

    /**
     * 根据roleId和peerIds获取roleDevice的集合
     * @param roleId roleId
     * @param peerIds peeerIds
     * @return 返回对应的roleDevice集合
     */
    List<RoleDevice> listRoleDeviceByRoleIdAndPeerIds(String roleId, List<String> peerIds);

    /**
     * 根据主键id批量删除
     * @param roleDeviceIds roleDevice的主键id集合
     */
    void batchDeleteByIds(List<String> roleDeviceIds);
}
